home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 November / PCWNOV07.iso / Software / Freeware / NSIS 2.29 / nsis-2.29-setup.exe / Examples / makensis.nsi < prev    next >
Encoding:
NSIS script  |  2007-07-14  |  33.3 KB  |  1,082 lines

  1. ;NSIS Setup Script
  2. ;--------------------------------
  3.  
  4. !ifndef VERSION
  5.   !define VERSION 'anonymous-build'
  6. !endif
  7.  
  8. ;--------------------------------
  9. ;Configuration
  10.  
  11. !ifdef OUTFILE
  12.   OutFile "${OUTFILE}"
  13. !else
  14.   OutFile ..\nsis-${VERSION}-setup.exe
  15. !endif
  16.  
  17. SetCompressor /SOLID lzma
  18.  
  19. InstType "Full"
  20. InstType "Lite"
  21. InstType "Minimal"
  22.  
  23. InstallDir $PROGRAMFILES\NSIS
  24. InstallDirRegKey HKLM Software\NSIS ""
  25.  
  26. RequestExecutionLevel admin
  27.  
  28. ;--------------------------------
  29. ;Header Files
  30.  
  31. !include "MUI.nsh"
  32. !include "Sections.nsh"
  33. !include "LogicLib.nsh"
  34. !include "Memento.nsh"
  35.  
  36. ;--------------------------------
  37. ;Definitions
  38.  
  39. !define SHCNE_ASSOCCHANGED 0x8000000
  40. !define SHCNF_IDLIST 0
  41.  
  42. ;--------------------------------
  43. ;Configuration
  44.  
  45. ;Names
  46. Name "NSIS"
  47. Caption "NSIS ${VERSION} Setup"
  48.  
  49. ;Memento Settings
  50. !define MEMENTO_REGISTRY_ROOT HKLM
  51. !define MEMENTO_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS"
  52.  
  53. ;Interface Settings
  54. !define MUI_ABORTWARNING
  55.  
  56. !define MUI_HEADERIMAGE
  57. !define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\nsis.bmp"
  58.  
  59. !define MUI_COMPONENTSPAGE_SMALLDESC
  60.  
  61. ;Pages
  62. !define MUI_WELCOMEPAGE_TITLE "Welcome to the NSIS ${VERSION} Setup Wizard"
  63. !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of NSIS (Nullsoft Scriptable Install System) ${VERSION}, the next generation of the Windows installer and uninstaller system that doesn't suck and isn't huge.\r\n\r\nNSIS 2 includes a new Modern User Interface, LZMA compression, support for multiple languages and an easy plug-in system.\r\n\r\n$_CLICK"
  64.  
  65. !insertmacro MUI_PAGE_WELCOME
  66. !insertmacro MUI_PAGE_LICENSE "..\COPYING"
  67. !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  68. Page custom PageReinstall PageLeaveReinstall
  69. !endif
  70. !insertmacro MUI_PAGE_COMPONENTS
  71. !insertmacro MUI_PAGE_DIRECTORY
  72. !insertmacro MUI_PAGE_INSTFILES
  73.  
  74. !define MUI_FINISHPAGE_LINK "Visit the NSIS site for the latest news, FAQs and support"
  75. !define MUI_FINISHPAGE_LINK_LOCATION "http://nsis.sf.net/"
  76.  
  77. !define MUI_FINISHPAGE_RUN "$INSTDIR\NSIS.exe"
  78. !define MUI_FINISHPAGE_NOREBOOTSUPPORT
  79.  
  80. !define MUI_FINISHPAGE_SHOWREADME
  81. !define MUI_FINISHPAGE_SHOWREADME_TEXT "Show release notes"
  82. !define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReleaseNotes
  83.  
  84. !insertmacro MUI_PAGE_FINISH
  85.  
  86. !insertmacro MUI_UNPAGE_CONFIRM
  87. !insertmacro MUI_UNPAGE_INSTFILES
  88.  
  89. ;--------------------------------
  90. ;Languages
  91.  
  92. !insertmacro MUI_LANGUAGE "English"
  93.  
  94. ;--------------------------------
  95. ;Reserve Files
  96.  
  97.   ;These files should be inserted before other files in the data block
  98.  
  99.   ReserveFile "makensis.ini"
  100.   !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
  101.  
  102. ;--------------------------------
  103. ;Installer Sections
  104.  
  105. ${MementoSection} "NSIS Core Files (required)" SecCore
  106.  
  107.   SetDetailsPrint textonly
  108.   DetailPrint "Installing NSIS Core Files..."
  109.   SetDetailsPrint listonly
  110.  
  111.   SectionIn 1 2 3 RO
  112.   SetOutPath $INSTDIR
  113.   RMDir /r $SMPROGRAMS\NSIS
  114.  
  115.   SetOverwrite on
  116.   File ..\makensis.exe
  117.   File ..\makensisw.exe
  118.   File ..\COPYING
  119.   File ..\NSIS.chm
  120.   File ..\NSIS.exe
  121.   File /nonfatal ..\NSIS.exe.manifest
  122.  
  123.   IfFileExists $INSTDIR\nsisconf.nsi "" +2
  124.   Rename $INSTDIR\nsisconf.nsi $INSTDIR\nsisconf.nsh
  125.   SetOverwrite off
  126.   File ..\nsisconf.nsh
  127.   SetOverwrite on
  128.  
  129.   SetOutPath $INSTDIR\Stubs
  130.   File ..\Stubs\bzip2
  131.   File ..\Stubs\bzip2_solid
  132.   File ..\Stubs\lzma
  133.   File ..\Stubs\lzma_solid
  134.   File ..\Stubs\zlib
  135.   File ..\Stubs\zlib_solid
  136.   File ..\Stubs\uninst
  137.  
  138.   SetOutPath $INSTDIR\Include
  139.   File ..\Include\WinMessages.nsh
  140.   File ..\Include\Sections.nsh
  141.   File ..\Include\Library.nsh
  142.   File ..\Include\UpgradeDLL.nsh
  143.   File ..\Include\LogicLib.nsh
  144.   File ..\Include\StrFunc.nsh
  145.   File ..\Include\Colors.nsh
  146.   File ..\Include\FileFunc.nsh
  147.   File ..\Include\TextFunc.nsh
  148.   File ..\Include\WordFunc.nsh
  149.   File ..\Include\WinVer.nsh
  150.   File ..\Include\x64.nsh
  151.   File ..\Include\Memento.nsh
  152.  
  153.   SetOutPath $INSTDIR\Docs\StrFunc
  154.   File ..\Docs\StrFunc\StrFunc.txt
  155.  
  156.   SetOutPath $INSTDIR\Docs\makensisw
  157.   File ..\Docs\makensisw\*.txt
  158.  
  159.   SetOutPath $INSTDIR\Menu
  160.   File ..\Menu\*.html
  161.   SetOutPath $INSTDIR\Menu\images
  162.   File ..\Menu\images\clear.gif
  163.   File ..\Menu\images\header.gif
  164.   File ..\Menu\images\line.gif
  165.   File ..\Menu\images\menu.gif
  166.   File ..\Menu\images\menud.gif
  167.   File ..\Menu\images\site.gif
  168.  
  169.   Delete $INSTDIR\makensis.htm
  170.   Delete $INSTDIR\Docs\*.html
  171.   Delete $INSTDIR\Docs\style.css
  172.   RMDir $INSTDIR\Docs
  173.  
  174.   SetOutPath $INSTDIR\Bin
  175.   File ..\Bin\LibraryLocal.exe
  176.   File ..\Bin\RegTool.bin
  177.  
  178.   SetOutPath $INSTDIR\Plugins
  179.   File ..\Plugins\TypeLib.dll
  180.  
  181.   ReadRegStr $R0 HKCR ".nsi" ""
  182.   StrCmp $R0 "NSISFile" 0 +2
  183.     DeleteRegKey HKCR "NSISFile"
  184.  
  185.   WriteRegStr HKCR ".nsi" "" "NSIS.Script"
  186.   WriteRegStr HKCR "NSIS.Script" "" "NSIS Script File"
  187.   WriteRegStr HKCR "NSIS.Script\DefaultIcon" "" "$INSTDIR\makensisw.exe,1"
  188.   ReadRegStr $R0 HKCR "NSIS.Script\shell\open\command" ""
  189.   StrCmp $R0 "" 0 no_nsiopen
  190.     WriteRegStr HKCR "NSIS.Script\shell" "" "open"
  191.     WriteRegStr HKCR "NSIS.Script\shell\open\command" "" 'notepad.exe "%1"'
  192.   no_nsiopen:
  193.   WriteRegStr HKCR "NSIS.Script\shell\compile" "" "Compile NSIS Script"
  194.   WriteRegStr HKCR "NSIS.Script\shell\compile\command" "" '"$INSTDIR\makensisw.exe" "%1"'
  195.   WriteRegStr HKCR "NSIS.Script\shell\compile-compressor" "" "Compile NSIS Script (Choose Compressor)"
  196.   WriteRegStr HKCR "NSIS.Script\shell\compile-compressor\command" "" '"$INSTDIR\makensisw.exe" /ChooseCompressor "%1"'
  197.  
  198.   ReadRegStr $R0 HKCR ".nsh" ""
  199.   StrCmp $R0 "NSHFile" 0 +2
  200.     DeleteRegKey HKCR "NSHFile"
  201.  
  202.   WriteRegStr HKCR ".nsh" "" "NSIS.Header"
  203.   WriteRegStr HKCR "NSIS.Header" "" "NSIS Header File"
  204.   WriteRegStr HKCR "NSIS.Header\DefaultIcon" "" "$INSTDIR\makensisw.exe,1"
  205.   ReadRegStr $R0 HKCR "NSIS.Header\shell\open\command" ""
  206.   StrCmp $R0 "" 0 no_nshopen
  207.     WriteRegStr HKCR "NSIS.Header\shell" "" "open"
  208.     WriteRegStr HKCR "NSIS.Header\shell\open\command" "" 'notepad.exe "%1"'
  209.   no_nshopen:
  210.  
  211.   System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
  212.  
  213. ${MementoSectionEnd}
  214.  
  215. ${MementoSection} "Script Examples" SecExample
  216.  
  217.   SetDetailsPrint textonly
  218.   DetailPrint "Installing Script Examples..."
  219.   SetDetailsPrint listonly
  220.  
  221.   SectionIn 1 2
  222.   SetOutPath $INSTDIR\Examples
  223.   File ..\Examples\makensis.nsi
  224.   File ..\Examples\makensis.ini
  225.   File ..\Examples\example1.nsi
  226.   File ..\Examples\example2.nsi
  227.   File ..\Examples\viewhtml.nsi
  228.   File ..\Examples\waplugin.nsi
  229.   File ..\Examples\bigtest.nsi
  230.   File ..\Examples\primes.nsi
  231.   File ..\Examples\rtest.nsi
  232.   File ..\Examples\gfx.nsi
  233.   File ..\Examples\one-section.nsi
  234.   File ..\Examples\languages.nsi
  235.   File ..\Examples\Library.nsi
  236.   File ..\Examples\VersionInfo.nsi
  237.   File ..\Examples\UserVars.nsi
  238.   File ..\Examples\LogicLib.nsi
  239.   File ..\Examples\silent.nsi
  240.   File ..\Examples\StrFunc.nsi
  241.   File ..\Examples\FileFunc.nsi
  242.   File ..\Examples\FileFunc.ini
  243.   File ..\Examples\FileFuncTest.nsi
  244.   File ..\Examples\TextFunc.nsi
  245.   File ..\Examples\TextFunc.ini
  246.   File ..\Examples\TextFuncTest.nsi
  247.   File ..\Examples\WordFunc.nsi
  248.   File ..\Examples\WordFunc.ini
  249.   File ..\Examples\WordFuncTest.nsi
  250.   File ..\Examples\Memento.nsi
  251.  
  252.   SetOutPath $INSTDIR\Examples\Plugin
  253.   File ..\Examples\Plugin\exdll.c
  254.   File ..\Examples\Plugin\exdll.dpr
  255.   File ..\Examples\Plugin\exdll.dsp
  256.   File ..\Examples\Plugin\exdll.dsw
  257.   File ..\Examples\Plugin\exdll.h
  258.   File ..\Examples\Plugin\exdll_with_unit.dpr
  259.   File ..\Examples\Plugin\extdll.inc
  260.   File ..\Examples\Plugin\nsis.pas
  261.  
  262. ${MementoSectionEnd}
  263.  
  264. !ifndef NO_STARTMENUSHORTCUTS
  265. ${MementoSection} "Start Menu and Desktop Shortcuts" SecShortcuts
  266.  
  267.   SetDetailsPrint textonly
  268.   DetailPrint "Installing Start Menu and Desktop Shortcuts..."
  269.   SetDetailsPrint listonly
  270.  
  271. !else
  272. ${MementoSection} "Desktop Shortcut" SecShortcuts
  273.  
  274.   SetDetailsPrint textonly
  275.   DetailPrint "Installing Desktop Shortcut..."
  276.   SetDetailsPrint listonly
  277.  
  278. !endif
  279.   SectionIn 1 2
  280.   SetOutPath $INSTDIR
  281. !ifndef NO_STARTMENUSHORTCUTS
  282.   CreateDirectory $SMPROGRAMS\NSIS
  283.  
  284.   CreateShortCut "$SMPROGRAMS\NSIS\NSIS Menu.lnk" "$INSTDIR\NSIS.exe" ""
  285.  
  286.   CreateShortCut "$SMPROGRAMS\NSIS\MakeNSISW (Compiler GUI).lnk" "$INSTDIR\makensisw.exe"
  287.  
  288.   CreateShortCut "$SMPROGRAMS\NSIS\NSIS Documentation.lnk" "$INSTDIR\NSIS.chm"
  289.   WriteINIStr "$SMPROGRAMS\NSIS\NSIS Site.url" "InternetShortcut" "URL" "http://nsis.sourceforge.net/"
  290.   CreateShortCut "$SMPROGRAMS\NSIS\Uninstall NSIS.lnk" "$INSTDIR\uninst-nsis.exe"
  291.  
  292. !endif
  293.  
  294.   CreateShortCut "$DESKTOP\Nullsoft Install System.lnk" "$INSTDIR\NSIS.exe"
  295.  
  296. ${MementoSectionEnd}
  297.  
  298. SectionGroup "User Interfaces" SecInterfaces
  299.  
  300. ${MementoSection} "Modern User Interface" SecInterfacesModernUI
  301.  
  302.   SetDetailsPrint textonly
  303.   DetailPrint "Installing User Interfaces | Modern User Interface..."
  304.   SetDetailsPrint listonly
  305.  
  306.   SectionIn 1 2
  307.  
  308.   SetOutPath "$INSTDIR\Examples\Modern UI"
  309.   File "..\Examples\Modern UI\Basic.nsi"
  310.   File "..\Examples\Modern UI\HeaderBitmap.nsi"
  311.   File "..\Examples\Modern UI\MultiLanguage.nsi"
  312.   File "..\Examples\Modern UI\InstallOptions.nsi"
  313.   File "..\Examples\Modern UI\ioA.ini"
  314.   File "..\Examples\Modern UI\ioB.ini"
  315.   File "..\Examples\Modern UI\ioC.ini"
  316.   File "..\Examples\Modern UI\StartMenu.nsi"
  317.   File "..\Examples\Modern UI\WelcomeFinish.nsi"
  318.  
  319.   SetOutPath "$INSTDIR\Contrib\Modern UI"
  320.   File "..\Contrib\Modern UI\System.nsh"
  321.   File "..\Contrib\Modern UI\ioSpecial.ini"
  322.  
  323.   SetOutPath "$INSTDIR\Docs\Modern UI"
  324.   File "..\Docs\Modern UI\Readme.html"
  325.   File "..\Docs\Modern UI\Changelog.txt"
  326.   File "..\Docs\Modern UI\License.txt"
  327.  
  328.   SetOutPath "$INSTDIR\Docs\Modern UI\images"
  329.   File "..\Docs\Modern UI\images\header.gif"
  330.   File "..\Docs\Modern UI\images\screen1.png"
  331.   File "..\Docs\Modern UI\images\screen2.png"
  332.   File "..\Docs\Modern UI\images\open.gif"
  333.   File "..\Docs\Modern UI\images\closed.gif"
  334.  
  335.   SetOutPath $INSTDIR\Contrib\UIs
  336.   File "..\Contrib\UIs\modern.exe"
  337.   File "..\Contrib\UIs\modern_headerbmp.exe"
  338.   File "..\Contrib\UIs\modern_headerbmpr.exe"
  339.   File "..\Contrib\UIs\modern_nodesc.exe"
  340.   File "..\Contrib\UIs\modern_smalldesc.exe"
  341.  
  342.   SetOutPath $INSTDIR\Include
  343.   File "..\Include\MUI.nsh"
  344.  
  345. ${MementoSectionEnd}
  346.  
  347. ${MementoSection} "Default User Interface" SecInterfacesDefaultUI
  348.  
  349.   SetDetailsPrint textonly
  350.   DetailPrint "Installing User Interfaces | Default User Interface..."
  351.   SetDetailsPrint listonly
  352.  
  353.   SectionIn 1
  354.  
  355.   SetOutPath "$INSTDIR\Contrib\UIs"
  356.   File "..\Contrib\UIs\default.exe"
  357.  
  358. ${MementoSectionEnd}
  359.  
  360. ${MementoSection} "Tiny User Interface" SecInterfacesTinyUI
  361.  
  362.   SetDetailsPrint textonly
  363.   DetailPrint "Installing User Interfaces | Tiny User Interface..."
  364.   SetDetailsPrint listonly
  365.  
  366.   SectionIn 1
  367.  
  368.   SetOutPath "$INSTDIR\Contrib\UIs"
  369.   File "..\Contrib\UIs\sdbarker_tiny.exe"
  370.  
  371. ${MementoSectionEnd}
  372.  
  373. SectionGroupEnd
  374.  
  375. ${MementoSection} "Graphics" SecGraphics
  376.  
  377.   SetDetailsPrint textonly
  378.   DetailPrint "Installing Graphics..."
  379.   SetDetailsPrint listonly
  380.  
  381.   SectionIn 1
  382.  
  383.   Delete $INSTDIR\Contrib\Icons\*.ico
  384.   Delete $INSTDIR\Contrib\Icons\*.bmp
  385.   RMDir $INSTDIR\Contrib\Icons
  386.   SetOutPath $INSTDIR\Contrib\Graphics
  387.   File /r "..\Contrib\Graphics\*.ico"
  388.   File /r "..\Contrib\Graphics\*.bmp"
  389. ${MementoSectionEnd}
  390.  
  391. ${MementoSection} "Language Files" SecLangFiles
  392.  
  393.   SetDetailsPrint textonly
  394.   DetailPrint "Installing Language Files..."
  395.   SetDetailsPrint listonly
  396.  
  397.   SectionIn 1
  398.  
  399.   SetOutPath "$INSTDIR\Contrib\Language files"
  400.   File "..\Contrib\Language files\*.nlf"
  401.  
  402.   SetOutPath $INSTDIR\Bin
  403.   File ..\Bin\MakeLangID.exe
  404.  
  405.   !insertmacro SectionFlagIsSet ${SecInterfacesModernUI} ${SF_SELECTED} mui nomui
  406.   mui:
  407.     SetOutPath "$INSTDIR\Contrib\Modern UI\Language files"
  408.     File "..\Contrib\Modern UI\Language files\*.nsh"
  409.   nomui:
  410.  
  411. ${MementoSectionEnd}
  412.  
  413. SectionGroup "Tools" SecTools
  414.  
  415. ${MementoSection} "Zip2Exe" SecToolsZ2E
  416.  
  417.   SetDetailsPrint textonly
  418.   DetailPrint "Installing Tools | Zip2Exe..."
  419.   SetDetailsPrint listonly
  420.  
  421.   SectionIn 1
  422.  
  423.   SetOutPath $INSTDIR\Bin
  424.   File ..\Bin\zip2exe.exe
  425.   SetOutPath $INSTDIR\Contrib\zip2exe
  426.   File ..\Contrib\zip2exe\Base.nsh
  427.   File ..\Contrib\zip2exe\Modern.nsh
  428.   File ..\Contrib\zip2exe\Classic.nsh
  429.  
  430. ${MementoSectionEnd}
  431.  
  432. SectionGroupEnd
  433.  
  434. SectionGroup "Plug-ins" SecPluginsPlugins
  435.  
  436. ${MementoSection} "Banner" SecPluginsBanner
  437.  
  438.   SetDetailsPrint textonly
  439.   DetailPrint "Installing Plug-ins | Banner..."
  440.   SetDetailsPrint listonly
  441.  
  442.   SectionIn 1
  443.  
  444.   SetOutPath $INSTDIR\Plugins
  445.   File ..\Plugins\Banner.dll
  446.   SetOutPath $INSTDIR\Docs\Banner
  447.   File ..\Docs\Banner\Readme.txt
  448.   SetOutPath $INSTDIR\Examples\Banner
  449.   File ..\Examples\Banner\Example.nsi
  450. ${MementoSectionEnd}
  451.  
  452. ${MementoSection} "Language DLL" SecPluginsLangDLL
  453.  
  454.   SetDetailsPrint textonly
  455.   DetailPrint "Installing Plug-ins | Language DLL..."
  456.   SetDetailsPrint listonly
  457.  
  458.   SectionIn 1
  459.   SetOutPath $INSTDIR\Plugins
  460.   File ..\Plugins\LangDLL.dll
  461. ${MementoSectionEnd}
  462.  
  463. ${MementoSection} "nsExec" SecPluginsnsExec
  464.  
  465.   SetDetailsPrint textonly
  466.   DetailPrint "Installing Plug-ins | nsExec..."
  467.   SetDetailsPrint listonly
  468.  
  469.   SectionIn 1
  470.  
  471.   SetOutPath $INSTDIR\Plugins
  472.   File ..\Plugins\nsExec.dll
  473.   SetOutPath $INSTDIR\Docs\nsExec
  474.   File ..\Docs\nsExec\nsExec.txt
  475.   SetOutPath $INSTDIR\Examples\nsExec
  476.   File ..\Examples\nsExec\test.nsi
  477. ${MementoSectionEnd}
  478.  
  479. ${MementoSection} "Splash" SecPluginsSplash
  480.  
  481.   SetDetailsPrint textonly
  482.   DetailPrint "Installing Plug-ins | Splash..."
  483.   SetDetailsPrint listonly
  484.  
  485.   SectionIn 1
  486.  
  487.   SetOutPath $INSTDIR\Plugins
  488.   File ..\Plugins\splash.dll
  489.   SetOutPath $INSTDIR\Docs\Splash
  490.   File ..\Docs\Splash\splash.txt
  491.   SetOutPath $INSTDIR\Examples\Splash
  492.   File ..\Examples\Splash\Example.nsi
  493. ${MementoSectionEnd}
  494.  
  495. ${MementoSection} "AdvSplash" SecPluginsSplashT
  496.  
  497.   SetDetailsPrint textonly
  498.   DetailPrint "Installing Plug-ins | AdvSplash..."
  499.   SetDetailsPrint listonly
  500.  
  501.   SectionIn 1
  502.  
  503.   SetOutPath $INSTDIR\Plugins
  504.   File ..\Plugins\advsplash.dll
  505.   SetOutPath $INSTDIR\Docs\AdvSplash
  506.   File ..\Docs\AdvSplash\advsplash.txt
  507.   SetOutPath $INSTDIR\Examples\AdvSplash
  508.   File ..\Examples\AdvSplash\Example.nsi
  509. ${MementoSectionEnd}
  510.  
  511. ${MementoSection} "BgImage" SecPluginsBgImage
  512.  
  513.   SetDetailsPrint textonly
  514.   DetailPrint "Installing Plug-ins | BgImage..."
  515.   SetDetailsPrint listonly
  516.  
  517.   SectionIn 1
  518.  
  519.   SetOutPath $INSTDIR\Plugins
  520.   File ..\Plugins\BgImage.dll
  521.   SetOutPath $INSTDIR\Docs\BgImage
  522.   File ..\Docs\BgImage\BgImage.txt
  523.   SetOutPath $INSTDIR\Examples\BgImage
  524.   File ..\Examples\BgImage\Example.nsi
  525. ${MementoSectionEnd}
  526.  
  527. ${MementoSection} "InstallOptions" SecPluginsIO
  528.  
  529.   SetDetailsPrint textonly
  530.   DetailPrint "Installing Plug-ins | InstallOptions..."
  531.   SetDetailsPrint listonly
  532.  
  533.   SectionIn 1
  534.  
  535.   SetOutPath $INSTDIR\Plugins
  536.   File ..\Plugins\InstallOptions.dll
  537.   SetOutPath $INSTDIR\Docs\InstallOptions
  538.   File ..\Docs\InstallOptions\Readme.html
  539.   File ..\Docs\InstallOptions\Changelog.txt
  540.   SetOutPath $INSTDIR\Examples\InstallOptions
  541.   File ..\Examples\InstallOptions\test.ini
  542.   File ..\Examples\InstallOptions\test.nsi
  543.   File ..\Examples\InstallOptions\testimgs.ini
  544.   File ..\Examples\InstallOptions\testimgs.nsi
  545.   File ..\Examples\InstallOptions\testlink.ini
  546.   File ..\Examples\InstallOptions\testlink.nsi
  547.   File ..\Examples\InstallOptions\testnotify.ini
  548.   File ..\Examples\InstallOptions\testnotify.nsi
  549. ${MementoSectionEnd}
  550.  
  551. ${MementoSection} "nsDialogs" SecPluginsDialogs
  552.  
  553.   SetDetailsPrint textonly
  554.   DetailPrint "Installing Plug-ins | nsDialogs..."
  555.   SetDetailsPrint listonly
  556.  
  557.   SectionIn 1
  558.  
  559.   SetOutPath $INSTDIR\Plugins
  560.   File ..\Plugins\nsDialogs.dll
  561.   SetOutPath $INSTDIR\Examples\nsDialogs
  562.   File ..\Examples\nsDialogs\example.nsi
  563.   File ..\Examples\nsDialogs\InstallOptions.nsi
  564.   File ..\Examples\nsDialogs\welcome.nsi
  565.   SetOutPath $INSTDIR\Include
  566.   File ..\Include\nsDialogs.nsh
  567. ${MementoSectionEnd}
  568.  
  569. ${MementoSection} "Math" SecPluginsMath
  570.  
  571.   SetDetailsPrint textonly
  572.   DetailPrint "Installing Plug-ins | Math..."
  573.   SetDetailsPrint listonly
  574.  
  575.   SectionIn 1
  576.  
  577.   SetOutPath $INSTDIR\Plugins
  578.   File ..\Plugins\Math.dll
  579.   SetOutPath $INSTDIR\Docs\Math
  580.   File ..\Docs\Math\Math.txt
  581.   SetOutPath $INSTDIR\Examples\Math
  582.   File ..\Examples\Math\math.nsi
  583.   File ..\Examples\Math\mathtest.txt
  584.   File ..\Examples\Math\mathtest.nsi
  585.   File ..\Examples\Math\mathtest.ini
  586.  
  587. ${MementoSectionEnd}
  588.  
  589. ${MementoSection} "NSISdl" SecPluginsNSISDL
  590.  
  591.   SetDetailsPrint textonly
  592.   DetailPrint "Installing Plug-ins | NSISdl..."
  593.   SetDetailsPrint listonly
  594.  
  595.   SectionIn 1
  596.  
  597.   SetOutPath $INSTDIR\Plugins
  598.   File ..\Plugins\nsisdl.dll
  599.   SetOutPath $INSTDIR\Docs\NSISdl
  600.   File ..\Docs\NSISdl\ReadMe.txt
  601.   File ..\Docs\NSISdl\License.txt
  602. ${MementoSectionEnd}
  603.  
  604. ${MementoSection} "System" SecPluginsSystem
  605.  
  606.   SetDetailsPrint textonly
  607.   DetailPrint "Installing Plug-ins | System..."
  608.   SetDetailsPrint listonly
  609.  
  610.   SectionIn 1
  611.  
  612.   SetOutPath $INSTDIR\Plugins
  613.   File ..\Plugins\System.dll
  614.   SetOutPath $INSTDIR\Docs\System
  615.   File ..\Docs\System\System.html
  616.   File ..\Docs\System\WhatsNew.txt
  617.   SetOutPath $INSTDIR\Examples\System
  618.   File ..\Examples\System\Resource.dll
  619.   File ..\Examples\System\SysFunc.nsh
  620.   File ..\Examples\System\System.nsh
  621.   File ..\Examples\System\System.nsi
  622. ${MementoSectionEnd}
  623.  
  624. ${MementoSection} "StartMenu" SecPluginsStartMenu
  625.  
  626.   SetDetailsPrint textonly
  627.   DetailPrint "Installing Plug-ins | StartMenu..."
  628.   SetDetailsPrint listonly
  629.  
  630.   SectionIn 1
  631.  
  632.   SetOutPath $INSTDIR\Plugins
  633.   File ..\Plugins\StartMenu.dll
  634.   SetOutPath $INSTDIR\Docs\StartMenu
  635.   File ..\Docs\StartMenu\Readme.txt
  636.   SetOutPath $INSTDIR\Examples\StartMenu
  637.   File ..\Examples\StartMenu\Example.nsi
  638. ${MementoSectionEnd}
  639.  
  640. ${MementoSection} "UserInfo" SecPluginsUserInfo
  641.  
  642.   SetDetailsPrint textonly
  643.   DetailPrint "Installing Plug-ins | UserInfo..."
  644.   SetDetailsPrint listonly
  645.  
  646.   SectionIn 1
  647.  
  648.   SetOutPath $INSTDIR\Plugins
  649.   File ..\Plugins\UserInfo.dll
  650.   SetOutPath $INSTDIR\Examples\UserInfo
  651.   File ..\Examples\UserInfo\UserInfo.nsi
  652. ${MementoSectionEnd}
  653.  
  654. ${MementoSection} "Dialer" SecPluginsDialer
  655.  
  656.   SetDetailsPrint textonly
  657.   DetailPrint "Installing Plug-ins | Dialer..."
  658.   SetDetailsPrint listonly
  659.  
  660.   SectionIn 1
  661.  
  662.   SetOutPath $INSTDIR\Plugins
  663.   File ..\Plugins\Dialer.dll
  664.   SetOutPath $INSTDIR\Docs\Dialer
  665.   File ..\Docs\Dialer\Dialer.txt
  666. ${MementoSectionEnd}
  667.  
  668. ${MementoSection} "VPatch" SecPluginsVPatch
  669.  
  670.   SetDetailsPrint textonly
  671.   DetailPrint "Installing Plug-ins | VPatch..."
  672.   SetDetailsPrint listonly
  673.  
  674.   SectionIn 1
  675.  
  676.   SetOutPath $INSTDIR\Plugins
  677.   File ..\Plugins\VPatch.dll
  678.   SetOutPath $INSTDIR\Examples\VPatch
  679.   File ..\Examples\VPatch\example.nsi
  680.   File ..\Examples\VPatch\oldfile.txt
  681.   File ..\Examples\VPatch\newfile.txt
  682.   File ..\Examples\VPatch\patch.pat
  683.   SetOutPath $INSTDIR\Docs\VPatch
  684.   File ..\Docs\VPatch\Readme.html
  685.   SetOutPath $INSTDIR\Bin
  686.   File ..\Bin\GenPat.exe
  687.   SetOutPath $INSTDIR\Include
  688.   File ..\Include\VPatchLib.nsh
  689. ${MementoSectionEnd}
  690.  
  691. ${MementoSectionDone}
  692.  
  693. SectionGroupEnd
  694.  
  695. Section -post
  696.  
  697.   ; When Modern UI is installed:
  698.   ; * Always install the English language file
  699.   ; * Always install default icons / bitmaps
  700.  
  701.   !insertmacro SectionFlagIsSet ${SecInterfacesModernUI} ${SF_SELECTED} mui nomui
  702.  
  703.     mui:
  704.  
  705.     SetDetailsPrint textonly
  706.     DetailPrint "Configuring Modern UI..."
  707.     SetDetailsPrint listonly
  708.  
  709.     !insertmacro SectionFlagIsSet ${SecLangFiles} ${SF_SELECTED} langfiles nolangfiles
  710.  
  711.       nolangfiles:
  712.  
  713.       SetOutPath "$INSTDIR\Contrib\Language files"
  714.       File "..\Contrib\Language files\English.nlf"
  715.       SetOutPath "$INSTDIR\Contrib\Modern UI\Language files"
  716.       File "..\Contrib\Modern UI\Language files\Default.nsh"
  717.       File "..\Contrib\Modern UI\Language files\English.nsh"
  718.  
  719.     langfiles:
  720.  
  721.     !insertmacro SectionFlagIsSet ${SecGraphics} ${SF_SELECTED} graphics nographics
  722.  
  723.       nographics:
  724.  
  725.       SetOutPath $INSTDIR\Contrib\Graphics
  726.       SetOutPath $INSTDIR\Contrib\Graphics\Checks
  727.       File "..\Contrib\Graphics\Checks\modern.bmp"
  728.       SetOutPath $INSTDIR\Contrib\Graphics\Icons
  729.       File "..\Contrib\Graphics\Icons\modern-install.ico"
  730.       File "..\Contrib\Graphics\Icons\modern-uninstall.ico"
  731.       SetOutPath $INSTDIR\Contrib\Graphics\Header
  732.       File "..\Contrib\Graphics\Header\nsis.bmp"
  733.       SetOutPath $INSTDIR\Contrib\Graphics\Wizard
  734.       File "..\Contrib\Graphics\Wizard\win.bmp"
  735.  
  736.     graphics:
  737.  
  738.   nomui:
  739.  
  740.   SetDetailsPrint textonly
  741.   DetailPrint "Creating Registry Keys..."
  742.   SetDetailsPrint listonly
  743.  
  744.   SetOutPath $INSTDIR
  745.  
  746.   WriteRegStr HKLM "Software\NSIS" "" $INSTDIR
  747. !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  748.   WriteRegDword HKLM "Software\NSIS" "VersionMajor" "${VER_MAJOR}"
  749.   WriteRegDword HKLM "Software\NSIS" "VersionMinor" "${VER_MINOR}"
  750.   WriteRegDword HKLM "Software\NSIS" "VersionRevision" "${VER_REVISION}"
  751.   WriteRegDword HKLM "Software\NSIS" "VersionBuild" "${VER_BUILD}"
  752. !endif
  753.  
  754.   WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "UninstallString" '"$INSTDIR\uninst-nsis.exe"'
  755.   WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "InstallLocation" "$INSTDIR"
  756.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "DisplayName" "Nullsoft Install System"
  757.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "DisplayIcon" "$INSTDIR\NSIS.exe,0"
  758.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "DisplayVersion" "${VERSION}"
  759. !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  760.   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "VersionMajor" "${VER_MAJOR}"
  761.   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "VersionMinor" "${VER_MINOR}.${VER_REVISION}"
  762. !endif
  763.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "URLInfoAbout" "http://nsis.sourceforge.net/"
  764.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "HelpLink" "http://nsis.sourceforge.net/Support"
  765.   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "NoModify" "1"
  766.   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "NoRepair" "1"
  767.  
  768. !ifndef NO_STARTMENUSHORTCUTS
  769.   IfFileExists $SMPROGRAMS\NSIS "" no_startshortcuts
  770.  
  771.   SetDetailsPrint textonly
  772.   DetailPrint "Creating Shortcuts..."
  773.   SetDetailsPrint listonly
  774.  
  775.   IfFileExists $INSTDIR\Examples 0 +2
  776.     CreateShortCut "$SMPROGRAMS\NSIS\NSIS Examples Directory.lnk" "$INSTDIR\Examples"
  777.  
  778.   ; MakeNSISW
  779.   CreateDirectory $SMPROGRAMS\NSIS\Contrib
  780.     CreateShortCut "$SMPROGRAMS\NSIS\Contrib\MakeNSISw Readme.lnk" "$INSTDIR\Docs\makensisw\readme.txt"
  781.  
  782.   ; ZIP2EXE
  783.   IfFileExists "$INSTDIR\Bin\zip2exe.exe" 0 +2
  784.     CreateShortCut "$SMPROGRAMS\NSIS\Contrib\zip2exe (Create SFX).lnk" "$INSTDIR\Bin\zip2exe.exe"
  785.  
  786.   ; Modern UI
  787.   Push "Modern UI"
  788.   Call AddReadmeToStartMenu
  789.  
  790.   ; Splash
  791.   Push Splash
  792.   Call AddReadmeToStartMenu
  793.  
  794.   ; Advanced splash
  795.   Push AdvSplash
  796.   Call AddReadmeToStartMenu
  797.  
  798.   ; Math
  799.   Push Math
  800.   Call AddReadmeToStartMenu
  801.  
  802.   ; NSISdl
  803.   Push NSISdl
  804.   Call AddReadmeToStartMenu
  805.  
  806.   ; nsExec
  807.   Push nsExec
  808.   Call AddReadmeToStartMenu
  809.  
  810.   ; StartMenu
  811.   Push StartMenu
  812.   Call AddReadmeToStartMenu
  813.  
  814.   ; BgImage
  815.   Push BgImage
  816.   Call AddReadmeToStartMenu
  817.  
  818.   ; Banner
  819.   Push Banner
  820.   Call AddReadmeToStartMenu
  821.  
  822.   ; System
  823.   Push System
  824.   Call AddReadmeToStartMenu
  825.  
  826.   ; VPatch
  827.   Push VPatch
  828.   Call AddReadmeToStartMenu
  829.  
  830.   ; InstallOptions
  831.   Push InstallOptions
  832.   Call AddReadmeToStartMenu
  833.  
  834.   no_startshortcuts:
  835. !endif
  836.  
  837.   WriteUninstaller $INSTDIR\uninst-nsis.exe
  838.  
  839.   ${MementoSectionSave}
  840.  
  841.   SetDetailsPrint both
  842.  
  843. SectionEnd
  844.  
  845. ;--------------------------------
  846. ;Descriptions
  847.  
  848. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  849.   !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "The core files required to use NSIS (compiler etc.)"
  850.   !insertmacro MUI_DESCRIPTION_TEXT ${SecExample} "Example installation scripts that show you how to use NSIS"
  851.   !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} "Adds icons to your start menu and your desktop for easy access"
  852.   !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfaces} "User interface designs that can be used to change the installer look and feel"
  853.   !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesModernUI} "A modern user interface like the wizards of recent Windows versions"
  854.   !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesDefaultUI} "The default NSIS user interface which you can customize to make your own UI"
  855.   !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesTinyUI} "A tiny version of the default user interface"
  856.   !insertmacro MUI_DESCRIPTION_TEXT ${SecTools} "Tools that help you with NSIS development"
  857.   !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsZ2E} "A utility that converts a ZIP file to a NSIS installer"
  858.   !insertmacro MUI_DESCRIPTION_TEXT ${SecGraphics} "Icons, checkbox images and other graphics"
  859.   !insertmacro MUI_DESCRIPTION_TEXT ${SecLangFiles} "Language files used to support multiple languages in an installer"
  860.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsPlugins} "Useful plugins that extend NSIS's functionality"
  861.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBanner} "Plugin that lets you show a banner before installation starts"
  862.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsLangDLL} "Plugin that lets you add a language select dialog to your installer"
  863.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsnsExec} "Plugin that executes console programs and prints its output in the NSIS log window or hides it"
  864.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSplash} "Splash screen add-on that lets you add a splash screen to an installer"
  865.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSplashT} "Splash screen add-on with transparency support that lets you add a splash screen to an installer"
  866.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSystem} "Plugin that lets you call Win32 API or external DLLs"
  867.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsMath} "Plugin that lets you evaluate complicated mathematical expressions"
  868.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsDialer} "Plugin that provides internet connection functions"
  869.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsIO} "Plugin that lets you add custom pages to an installer"
  870.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsDialogs} "Plugin that lets you add custom pages to an installer"
  871.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsStartMenu} "Plugin that lets the user select the start menu folder"
  872.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBgImage} "Plugin that lets you show a persistent background image plugin and play sounds"
  873.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsUserInfo} "Plugin that that gives you the user name and the user account type"
  874.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsNSISDL} "Plugin that lets you create a web based installer"
  875.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsVPatch} "Plugin that lets you create patches to upgrade older files"
  876. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  877.  
  878. ;--------------------------------
  879. ;Installer Functions
  880.  
  881. Function .onInit
  882.  
  883. !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  884.  
  885.   !insertmacro MUI_INSTALLOPTIONS_EXTRACT "makensis.ini"
  886.  
  887. !endif
  888.   
  889.   ${MementoSectionRestore}
  890.  
  891. FunctionEnd
  892.  
  893. !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  894.  
  895. Function PageReinstall
  896.  
  897.   ReadRegStr $R0 HKLM "Software\NSIS" ""
  898.  
  899.   StrCmp $R0 "" 0 +2
  900.     Abort
  901.  
  902.   ;Detect version
  903.     ReadRegDWORD $R0 HKLM "Software\NSIS" "VersionMajor"
  904.     IntCmp $R0 ${VER_MAJOR} minor_check new_version older_version
  905.   minor_check:
  906.     ReadRegDWORD $R0 HKLM "Software\NSIS" "VersionMinor"
  907.     IntCmp $R0 ${VER_MINOR} revision_check new_version older_version
  908.   revision_check:
  909.     ReadRegDWORD $R0 HKLM "Software\NSIS" "VersionRevision"
  910.     IntCmp $R0 ${VER_REVISION} build_check new_version older_version
  911.   build_check:
  912.     ReadRegDWORD $R0 HKLM "Software\NSIS" "VersionBuild"
  913.     IntCmp $R0 ${VER_BUILD} same_version new_version older_version
  914.  
  915.   new_version:
  916.  
  917.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 1" "Text" "An older version of NSIS is installed on your system. It's recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
  918.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 2" "Text" "Uninstall before installing"
  919.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 3" "Text" "Do not uninstall"
  920.    !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install NSIS."
  921.    StrCpy $R0 "1"
  922.    Goto reinst_start
  923.  
  924.   older_version:
  925.  
  926.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 1" "Text" "A newer version of NSIS is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
  927.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 2" "Text" "Uninstall before installing"
  928.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 3" "Text" "Do not uninstall"
  929.    !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install NSIS."
  930.    StrCpy $R0 "1"
  931.    Goto reinst_start
  932.  
  933.   same_version:
  934.  
  935.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 1" "Text" "NSIS ${VERSION} is already installed. Select the operation you want to perform and click Next to continue."
  936.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 2" "Text" "Add/Reinstall components"
  937.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 3" "Text" "Uninstall NSIS"
  938.    !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform."
  939.    StrCpy $R0 "2"
  940.  
  941.   reinst_start:
  942.  
  943.   !insertmacro MUI_INSTALLOPTIONS_DISPLAY "makensis.ini"
  944.  
  945. FunctionEnd
  946.  
  947. Function PageLeaveReinstall
  948.  
  949.   !insertmacro MUI_INSTALLOPTIONS_READ $R1 "makensis.ini" "Field 2" "State"
  950.  
  951.   StrCmp $R0 "1" 0 +2
  952.     StrCmp $R1 "1" reinst_uninstall reinst_done
  953.  
  954.   StrCmp $R0 "2" 0 +3
  955.     StrCmp $R1 "1" reinst_done reinst_uninstall
  956.  
  957.   reinst_uninstall:
  958.   ReadRegStr $R1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "UninstallString"
  959.  
  960.   ;Run uninstaller
  961.   HideWindow
  962.  
  963.     ClearErrors
  964.     ExecWait '$R1 _?=$INSTDIR'
  965.  
  966.     IfErrors no_remove_uninstaller
  967.     IfFileExists "$INSTDIR\makensis.exe" no_remove_uninstaller
  968.  
  969.       Delete $R1
  970.       RMDir $INSTDIR
  971.  
  972.     no_remove_uninstaller:
  973.  
  974.   StrCmp $R0 "2" 0 +2
  975.     Quit
  976.  
  977.   BringToFront
  978.  
  979.   reinst_done:
  980.  
  981. FunctionEnd
  982.  
  983. !endif # VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  984.  
  985. !ifndef NO_STARTMENUSHORTCUTS
  986. Function AddReadmeToStartMenu
  987.   Pop $0
  988.   StrCpy $1 "$0 Readme"
  989.   IfFileExists $INSTDIR\Docs\$0\$0.txt 0 +3
  990.     StrCpy $0 Docs\$0\$0.txt
  991.     Goto create
  992.   IfFileExists $INSTDIR\Docs\$0\$0.html 0 +3
  993.     StrCpy $0 Docs\$0\$0.html
  994.     Goto create
  995.   IfFileExists $INSTDIR\Docs\$0\Readme.txt 0 +3
  996.     StrCpy $0 Docs\$0\Readme.txt
  997.     Goto create
  998.   IfFileExists $INSTDIR\Docs\$0\Readme.html 0 done
  999.     StrCpy $0 Docs\$0\Readme.html
  1000.   create:
  1001.     CreateShortCut $SMPROGRAMS\NSIS\Contrib\$1.lnk $INSTDIR\$0
  1002.   done:
  1003. FunctionEnd
  1004. !endif
  1005.  
  1006. Function ShowReleaseNotes
  1007.   ${If} ${FileExists} $WINDIR\hh.exe
  1008.     StrCpy $0 $WINDIR\hh.exe
  1009.     Exec '"$0" mk:@MSITStore:$INSTDIR\NSIS.chm::/SectionF.1.html'
  1010.   ${Else}
  1011.     SearchPath $0 hh.exe
  1012.     ${If} ${FileExists} $0
  1013.       Exec '"$0" mk:@MSITStore:$INSTDIR\NSIS.chm::/SectionF.1.html'
  1014.     ${Else}
  1015.       ExecShell "open" "http://nsis.sourceforge.net/Docs/AppendixF.html#F.1"
  1016.     ${EndIf}
  1017.   ${EndIf}
  1018. FunctionEnd
  1019.  
  1020. ;--------------------------------
  1021. ;Uninstaller Section
  1022.  
  1023. Section Uninstall
  1024.  
  1025.   SetDetailsPrint textonly
  1026.   DetailPrint "Uninstalling NSI Development Shell Extensions..."
  1027.   SetDetailsPrint listonly
  1028.  
  1029.   IfFileExists $INSTDIR\makensis.exe nsis_installed
  1030.     MessageBox MB_YESNO "It does not appear that NSIS is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?" IDYES nsis_installed
  1031.     Abort "Uninstall aborted by user"
  1032.   nsis_installed:
  1033.  
  1034.   SetDetailsPrint textonly
  1035.   DetailPrint "Deleting Registry Keys..."
  1036.   SetDetailsPrint listonly
  1037.  
  1038.   ReadRegStr $R0 HKCR ".nsi" ""
  1039.   StrCmp $R0 "NSIS.Script" 0 +2
  1040.     DeleteRegKey HKCR ".nsi"
  1041.  
  1042.   ReadRegStr $R0 HKCR ".nsh" ""
  1043.   StrCmp $R0 "NSIS.Header" 0 +2
  1044.     DeleteRegKey HKCR ".nsh"
  1045.  
  1046.   DeleteRegKey HKCR "NSIS.Script"
  1047.   DeleteRegKey HKCR "NSIS.Header"
  1048.  
  1049.   System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
  1050.  
  1051.   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS"
  1052.   DeleteRegKey HKLM "Software\NSIS"
  1053.  
  1054.   SetDetailsPrint textonly
  1055.   DetailPrint "Deleting Files..."
  1056.   SetDetailsPrint listonly
  1057.  
  1058.   RMDir /r $SMPROGRAMS\NSIS
  1059.   Delete "$DESKTOP\Nullsoft Install System.lnk"
  1060.   Delete $INSTDIR\makensis.exe
  1061.   Delete $INSTDIR\makensisw.exe
  1062.   Delete $INSTDIR\NSIS.exe
  1063.   Delete $INSTDIR\license.txt
  1064.   Delete $INSTDIR\COPYING
  1065.   Delete $INSTDIR\uninst-nsis.exe
  1066.   Delete $INSTDIR\nsisconf.nsi
  1067.   Delete $INSTDIR\nsisconf.nsh
  1068.   Delete $INSTDIR\NSIS.chm
  1069.   RMDir /r $INSTDIR\Bin
  1070.   RMDir /r $INSTDIR\Contrib
  1071.   RMDir /r $INSTDIR\Docs
  1072.   RMDir /r $INSTDIR\Examples
  1073.   RMDir /r $INSTDIR\Include
  1074.   RMDir /r $INSTDIR\Menu
  1075.   RMDir /r $INSTDIR\Plugins
  1076.   RMDir /r $INSTDIR\Stubs
  1077.   RMDir $INSTDIR
  1078.  
  1079.   SetDetailsPrint both
  1080.  
  1081. SectionEnd
  1082.